﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CinemaSystem
{
    public partial class glzc : Form
    {
        public glzc()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string sqlstr;
            sqlstr = string.Empty;
            if (txtzhang.Text == "" || txtpwd.Text == "" || txtpwd.Text == "")
            {
                MessageBox.Show("信息填写不完整！");
            }
            else if (txtpwd.Text== txtpwdz.Text){
                sqlstr = string.Format("insert into Administrators values('{0}','{1}')",txtzhang.Text, txtpwd.Text);
                int i = DBHelper.ExecuteNonQuery(sqlstr);
                if (i > 0)
                {
                    MessageBox.Show("注册成功！");
                    guali guali = new guali();
                    guali.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("注册失败！");
                }
            }
            else
            {
                MessageBox.Show("两次输入的密码不一致");
            }
        }

        private void glzc_Load(object sender, EventArgs e)
        {
            skinEngine1.SkinFile = System.Environment.CurrentDirectory + "\\Skins\\Wave.ssk";
        }
    }
}
